package Fibonacci;

import java.util.Scanner;

public class Fibonacci {

	public static void main(String[] args) {
		
		Scanner sc =new Scanner(System.in);
		int n=sc.nextInt();
		
		int[] F=new int[n+2];
		F[1]=1;
		F[2]=1;
		if(n>2){
			for(int i=3;i<=n;i++){
				F[i]=(F[i-1]+F[i-2])%10007;//用来保存余数
			}			
		}
		System.out.println(F[n]);
	}
}
